package cn.yuanqiao.archive.danganzhengli.domain;

import java.util.List;
import java.util.Date;

import cn.yuanqiao.common.annotation.Excel;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.exception.ServiceException;
import cn.yuanqiao.common.utils.SecurityUtils;
import cn.yuanqiao.common.utils.StringUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;


/**
 * 打包日志对象 A001_YQ_PACK
 * 
 * @author xy
 * @date 2024-09-13
 */
public class ArchivePack extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    private final String BIGTABLENAME = "_YQ_PACK";

    public ArchivePack() {
        String tenantCode = SecurityUtils.getTenantCode();
        if(StringUtils.isEmpty(tenantCode)){
            tenantCode = SecurityUtils.getLoginUser().getUser().getTenantCode();
            if (StringUtils.isEmpty(tenantCode)){
                //throw new ServiceException("TenantCode is null");
            }
        }
        this.tableName = tenantCode.toUpperCase()+BIGTABLENAME;
    }

    private String tableName;

    /** id */
    @Excel(name = "id")
    private Long id;

    /** 门类id */
    @Excel(name = "门类id")
    private Long categoryId;

    /** 打包开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "打包开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date packTime;

    /** 打包结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "打包结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date edPackTime;

    /** 状态 */
    @Excel(name = "状态")
    private String state;

    /** 创建人ID */
    @Excel(name = "创建人ID")
    private Long createId;

    private String path;

    private String fileName;

    private Integer num;

    private String categoryName;

    private String userName;
    /** 打包档案详情信息 */
    private List<PackDetail> packDetailList;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setCategoryId(Long categoryId) 
    {
        this.categoryId = categoryId;
    }

    public Long getCategoryId() 
    {
        return categoryId;
    }
    public void setPackTime(Date packTime) 
    {
        this.packTime = packTime;
    }

    public Date getPackTime() 
    {
        return packTime;
    }
    public void setEdPackTime(Date edPackTime) 
    {
        this.edPackTime = edPackTime;
    }

    public Date getEdPackTime() 
    {
        return edPackTime;
    }
    public void setState(String state) 
    {
        this.state = state;
    }

    public String getState() 
    {
        return state;
    }
    public void setCreateId(Long createId) 
    {
        this.createId = createId;
    }

    public Long getCreateId() 
    {
        return createId;
    }

    public List<PackDetail> getPackDetailList()
    {
        return packDetailList;
    }

    public void setPackDetailList(List<PackDetail> packDetailList)
    {
        this.packDetailList = packDetailList;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Override
    public String toString() {
        return "ArchivePack{" +
                "BIGTABLENAME='" + BIGTABLENAME + '\'' +
                ", tableName='" + tableName + '\'' +
                ", id=" + id +
                ", categoryId=" + categoryId +
                ", packTime=" + packTime +
                ", edPackTime=" + edPackTime +
                ", state='" + state + '\'' +
                ", createId=" + createId +
                ", path='" + path + '\'' +
                ", fileName='" + fileName + '\'' +
                ", categoryName='" + categoryName + '\'' +
                ", packDetailList=" + packDetailList +
                '}';
    }
}
